﻿using Microsoft.Extensions.Configuration;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Demo.Net.SqlSugar;
using Demo.Net.Service.Service;
using Demo.Net.Serilog;

namespace Microsoft.Extensions.DependencyInjection
{
    public static class   ServiceExtensions
    {
        public static IServiceCollection AddDemoNetService(this IServiceCollection services, IConfiguration configuration)
        {
            #region 数据仓储
            services.AddSqlSugarExtensions(configuration);
            services.AddDapperExtensions(configuration);
            services.AddEFCoreExtensions(configuration);
            #endregion

            #region 实现服务

            services.AddTransient<SqlSugarService>();
            services.AddTransient<DapperService>();
            services.AddTransient<EFCoreService>();


            //注入日志服务
            //services.AddSerilogPgSqlClient(configuration);
            //services.AddSerilogFileClient(configuration);
          //  services.AddSerilogEsClient(configuration);


            #endregion

            return services;
            
        }
    }
}
